/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.sql.Connection;
import java.sql.PreparedStatement;

import java.sql.ResultSet;


//import net.proteanit.sql.DbUtils;

import main.BarApplication;

import model.Member;

/**
 *
 * @author Home
 */
public class Home extends LoginScreen {

    /**
     * Creates new form LedenManager
     */
    ResultSet rs = null;
    Connection conn = null;
    PreparedStatement pst = null;
    private LoginScreen login;
    private Member lid;
    private String SoortRecht;
//    private String GebruikersEmail;
   private int GebruikersNummer;
    
    public Home(LoginScreen login) {

        initComponents();
        this.login = login;
        loginShow();


    }

    private void loginShow() {
//    GebruikersNummer= login.getGebruikersNummer();
        
        SoortRecht = login.getSoortRecht();

        if ("Medewerker".equals(SoortRecht)) {
            System.out.println("functie ==" + soortRecht);

            Beheer_btn2.setVisible(false);
            Verkoop_btn1.setVisible(false);
            

        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        Content_Panel = new javax.swing.JPanel();
        Verkoop_btn1 = new javax.swing.JButton();
        Activiteit_btn5 = new javax.swing.JButton();
        Leden_jBtn = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel_AantalLeden = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        Bar_btn3 = new javax.swing.JButton();
        Beheer_btn2 = new javax.swing.JButton();
        Factuur_btn2 = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));
        setPreferredSize(new java.awt.Dimension(960, 600));

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel7.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(4, 54, 128));
        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-frontpage.png"))); // NOI18N
        jLabel7.setText("Home Overzicht");

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Apps-session-logout-icon.png"))); // NOI18N
        jLabel1.setText("logout");
        jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel7))
                .addContainerGap())
        );

        jScrollPane1.setPreferredSize(new java.awt.Dimension(633, 400));

        Content_Panel.setPreferredSize(new java.awt.Dimension(631, 280));

        Verkoop_btn1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/line-chart-icon.png"))); // NOI18N
        Verkoop_btn1.setText("Verkoop");
        Verkoop_btn1.setPreferredSize(new java.awt.Dimension(137, 105));
        Verkoop_btn1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Verkoop_btn1ActionPerformed(evt);
            }
        });

        Activiteit_btn5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-banner-tracks.png"))); // NOI18N
        Activiteit_btn5.setText("Activiteit");
        Activiteit_btn5.setMaximumSize(new java.awt.Dimension(125, 57));
        Activiteit_btn5.setMinimumSize(new java.awt.Dimension(125, 57));
        Activiteit_btn5.setPreferredSize(new java.awt.Dimension(173, 105));
        Activiteit_btn5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Activiteit_btn5ActionPerformed(evt);
            }
        });

        Leden_jBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/User-group-64.png"))); // NOI18N
        Leden_jBtn.setText("Leden");
        Leden_jBtn.setMaximumSize(new java.awt.Dimension(125, 57));
        Leden_jBtn.setMinimumSize(new java.awt.Dimension(125, 57));
        Leden_jBtn.setPreferredSize(new java.awt.Dimension(173, 105));
        Leden_jBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Leden_jBtnActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel_AantalLeden.setText("Aantal leden");

        jTextField1.setEditable(false);
        jTextField1.setText("3000");
        jTextField1.setBorder(null);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jLabel8.setText("Actieve leden");

        jTextField2.setEditable(false);
        jTextField2.setText("2500");
        jTextField2.setBorder(null);

        jLabel9.setText("inactieve leden");

        jTextField3.setEditable(false);
        jTextField3.setText("500");
        jTextField3.setBorder(null);
        jTextField3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(jLabel_AantalLeden)
                    .addComponent(jLabel9))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                            .addComponent(jTextField1)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jTextField3)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_AantalLeden)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        Bar_btn3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Basket-64.png"))); // NOI18N
        Bar_btn3.setText("   Bar");
        Bar_btn3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Bar_btn3ActionPerformed(evt);
            }
        });

        Beheer_btn2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-cpanel.png"))); // NOI18N
        Beheer_btn2.setText("Beheer");
        Beheer_btn2.setMaximumSize(new java.awt.Dimension(125, 57));
        Beheer_btn2.setMinimumSize(new java.awt.Dimension(125, 57));
        Beheer_btn2.setPreferredSize(new java.awt.Dimension(173, 105));
        Beheer_btn2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Beheer_btn2ActionPerformed(evt);
            }
        });

        Factuur_btn2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/invoice-icon.png"))); // NOI18N
        Factuur_btn2.setText("Factuur");
        Factuur_btn2.setPreferredSize(new java.awt.Dimension(137, 105));
        Factuur_btn2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Factuur_btn2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout Content_PanelLayout = new javax.swing.GroupLayout(Content_Panel);
        Content_Panel.setLayout(Content_PanelLayout);
        Content_PanelLayout.setHorizontalGroup(
            Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Content_PanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Content_PanelLayout.createSequentialGroup()
                        .addComponent(Leden_jBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(26, 26, 26))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Content_PanelLayout.createSequentialGroup()
                        .addComponent(Factuur_btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)))
                .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Beheer_btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Activiteit_btn5, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Bar_btn3, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Verkoop_btn1, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 167, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        Content_PanelLayout.setVerticalGroup(
            Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Content_PanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(Content_PanelLayout.createSequentialGroup()
                        .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(Activiteit_btn5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(Bar_btn3, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(Leden_jBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(Content_PanelLayout.createSequentialGroup()
                                .addGap(24, 24, 24)
                                .addGroup(Content_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(Beheer_btn2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(Factuur_btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(Content_PanelLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(Verkoop_btn1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE)))))
                .addGap(0, 42, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(Content_Panel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 960, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(231, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField3ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void Leden_jBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Leden_jBtnActionPerformed
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new MemberOverview(login));

    }//GEN-LAST:event_Leden_jBtnActionPerformed

    private void Bar_btn3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Bar_btn3ActionPerformed
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new shopping_bar(login));
    }//GEN-LAST:event_Bar_btn3ActionPerformed

    private void Verkoop_btn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Verkoop_btn1ActionPerformed
        // TODO add your handling code here:
          BarApplication.getInstance().showPanel(new VerkoopOverview(login));
    }//GEN-LAST:event_Verkoop_btn1ActionPerformed

    private void Activiteit_btn5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Activiteit_btn5ActionPerformed

        BarApplication.getInstance().showPanel(new GroupActivityOverview(login));

    }//GEN-LAST:event_Activiteit_btn5ActionPerformed

    private void Beheer_btn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Beheer_btn2ActionPerformed
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new Beheer(login));
    }//GEN-LAST:event_Beheer_btn2ActionPerformed

    private void Factuur_btn2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Factuur_btn2ActionPerformed
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new FactuurOverview(login));
    }//GEN-LAST:event_Factuur_btn2ActionPerformed

    private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new LoginScreen());
    }//GEN-LAST:event_jLabel1MouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Activiteit_btn5;
    private javax.swing.JButton Bar_btn3;
    public javax.swing.JButton Beheer_btn2;
    private javax.swing.JPanel Content_Panel;
    private javax.swing.JButton Factuur_btn2;
    private javax.swing.JButton Leden_jBtn;
    private javax.swing.JButton Verkoop_btn1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel_AantalLeden;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    // End of variables declaration//GEN-END:variables
}
